package com.hexacta.hrs.service.staffing.impl;

import java.util.Collection;
import java.util.List;

import com.hexacta.hrs.domain.staffing.Client;
import com.hexacta.hrs.repositories.ClientRepository;
import com.hexacta.hrs.service.staffing.ClientService;

public class ClientServiceImpl implements ClientService {

    private ClientRepository clientRepository;
	
	@Override
	public Client createNew() {
		return new Client();
	}

	@Override
	public void delete(Client recordObject) {
		this.getClientRepository().delete(recordObject);
	}

	@Override
	public void save(Client recordObject) {
		this.getClientRepository().saveOrUpdate(recordObject);
	}

	@Override
	public Collection<Client> searchByCriteria(Client criteria) {
		return this.getClientRepository().matching(criteria);
	}

	@Override
	public Client searchById(long id) {
		return this.getClientRepository().findById(id);
	}

	public void setClientRepository(ClientRepository clientRepository) {
		this.clientRepository = clientRepository;
	}

	public ClientRepository getClientRepository() {
		return clientRepository;
	}

	@Override
	public List<Client> findAll() {
		return this.getClientRepository().findAll();
	}

}
